Matching Revit elements with BHoM objects
Exchange of information between Revit and BHoM often requires linking the objects from both sides with each other, e.g. when querying the model for changes or updating it. The mutual relationship is being created and maintained as follows:
- On Pull, the identifiers of pulled Revit element are stored in
RevitIdentifiers
fragment attached to the resultant BHoM object. - On Push, Revit element is being considered correspondent to a BHoM object when the latter contains a
RevitIdentifiers
fragment with value ofElementId
property equal to the ElementId of the former.
RevitIdentifiers
As mentioned in the previous section, the information about identity of a Revit element correspondent to a BHoM object is stored in RevitIdentifiers
fragment of the latter. That fragment contains a few important pieces of information:
PersistentId
- global, software-agnostic identifier used by BHoM, in Revit correspondent to element's UniqueIdElementId
- ElementId of the Revit element correspondent to the BHoM objectCategoryName
- Category of the Revit element correspondent to the BHoM objectFamilyName
- Family of the Revit element correspondent to the BHoM objectFamilyTypeName
- Family type of the Revit element correspondent to the BHoM objectFamilyTypeId
- ElementId of family type of the Revit element correspondent to the BHoM objectWorkset
- Workset of the Revit element correspondent to the BHoM objectHostId
- ElementId of the Revit element hosting the Revit element correspondent to the BHoM objectOwnerViewId
- ElementId of view that owns the Revit element correspondent to the BHoM objectParentElementId
- ElementId of the parent element of the Revit element correspondent to the BHoM objectLinkPath
- path to the link document that owns the Revit element correspondent to the BHoM object
The identifiers of a BHoM object can be retrieved with GetRevitIdentifiers
method.